package driver

import (
	"gitee.com/mkwchecking/sr-core/yal/ymap"
	"gorm.io/gorm"
)

type DialectorFac func(Conn) gorm.Dialector

var _contaienr = ymap.New[Engine, DialectorFac]()

func Register(eng Engine, fc DialectorFac) {
	_contaienr.Register(eng, fc)
}

func GetDriver(eng Engine) (DialectorFac, bool) {
	return _contaienr.Get(eng)
}
